/*
 * @Description: 移交任务
 * @Author: Zzt
 * @Date: 2023-01-31 18:40:03
 * @LastEditTime: 2023-03-03 10:23:27
 */

import { Button, Dropdown, Menu } from 'antd';
import Handover from './components/Handover';
import { EnumReceiveTypes, receiveTypeName } from '@/dictionary/transfer';

interface IHandoverTasksBtn {
  selectItems: [];
  info: any;
}
const HandoverTasksBtn = (props: IHandoverTasksBtn) => {
  const { selectItems, info } = props;

  const menu = (
    <Menu
      items={[
        {
          key: 'excel',
          label: <Handover info={info} selectItems={selectItems} />
        },
        {
          key: 'cd',
          label: receiveTypeName(EnumReceiveTypes.CD)
        },
        {
          key: 'sip',
          label: receiveTypeName(EnumReceiveTypes.SIP)
        },
        {
          key: 'zip',
          label: <Handover info={info} selectItems={selectItems} type={EnumReceiveTypes.ZIP} />
        }
      ]}
    />
  );
  return (
    <>
      <Dropdown
        disabled={selectItems.length === 0}
        overlay={menu}
        placement="bottom"
        trigger={['click']}
      >
        <Button>移交</Button>
      </Dropdown>
    </>
  );
};
export default HandoverTasksBtn;
